package com.xqboss.apps.domain.sys;

import java.util.Date;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xqboss.apps.domain.BaseTable;
import com.xqboss.apps.enums.sys.JobConfigStateEnum;
import com.xqboss.apps.enums.sys.JobConfigTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 定时任务
 * </p>
 *
 * @author admin
 * @since 2024-03-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Job对象", description="定时任务配置")
public class Job extends BaseTable implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键，定时任务配置id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "任务类型（1-加油运动场）")
    @NotNull(message = "任务类型不能为空~")
    private JobConfigStateEnum state;

    @ApiModelProperty(value = "任务名称")
    @NotNull(message = "任务名称不能为空~")
    private String name;

    @ApiModelProperty(value = "1-关闭的任务 2-开启的任务 3-过期的任务")
    private JobConfigTypeEnum type;

    @ApiModelProperty(value = "定时任务-关闭时间")
    @NotNull(message = "定时任务-关闭时间不能为空~")
    private Date jobCloseTime;

    @ApiModelProperty(value = "定时任务-开启时间")
    @NotNull(message = "定时任务-开启时间不能为空~")
    private Date jobOpenTime;

    @ApiModelProperty(value = "是否在使用中，默认false")
    @JsonIgnore
    private Boolean isUse;
}
